package com.woniu.common;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class ResponseData<T> {
    private Integer code;
    private String msg;
    private T data;





    public ResponseData ok(){
        return new ResponseData(ResponseEnum.Ok.getCode(),ResponseEnum.Ok.getMsg(),null);
    }
    public ResponseData ok(T data){
        return new ResponseData(ResponseEnum.Ok.getCode(),ResponseEnum.Ok.getMsg(),data);
    }
    public ResponseData fail(ResponseEnum responseEnum){
        return new ResponseData(responseEnum.getCode(), responseEnum.getMsg(), null);
    }
}
